﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SStateMachine
{
    public partial class StateMachine<TState, TTrigger>
    {
        public class Transition
        {
            public TState Source { get; private set; }
            public TState Destination { get; private set; }

            public Transition(TState source, TState destination)
            {
                this.Source = source;
                this.Destination = destination;
            }

            public bool GetDestination(TState source, out TState destination)
            {
                destination = default;

                if (source == null || !source.Equals(this.Source))
                    return false;

                destination = this.Destination;
                return true;
            }
        }
    }
}
